// 导入对应的 React 路由组件
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'

// 路由组件
import Login from '@/components/Login.jsx'
import Main from '@/components/Main.jsx'
import NotFond from '@/components/404.jsx'
// 子路由组件
import Users from '@/components/Menus/MyUsers.jsx'
import Rights from '@/components/Menus/MyRights.jsx'
import Goods from '@/components/Menus/MyGoods.jsx'
import Orders from '@/components/Menus/MyOrders.jsx'
import Settings from '@/components/Menus/MySettings.jsx'
import UserDetail from '@/components/UserDetail/UserDetail.jsx'

export default function App() {
  return (
    <Router>
      <Routes>
        <Route path="/login" element={<Login />}></Route>
        <Route path="/" element={<Main />}>
          <Route path="users" element={<Users />} />
          <Route path="rights" element={<Rights />} />
          <Route path="goods" element={<Goods />} />
          <Route path="orders" element={<Orders />} />
          <Route path="settings" element={<Settings />} />
          <Route path="users/:id" element={<UserDetail />} />
        </Route>
        <Route path="*" element={<NotFond />}></Route>
      </Routes>
    </Router>
  )
}
